package com.example.dialog.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import com.example.dialog.R;

// Ensure these imports are correct
import com.example.dialog.Activity.HomeActivity;
import com.example.dialog.Activity.CreateActivity;
import com.example.dialog.Activity.MessageActivity;
import com.example.dialog.Activity.ProfileActivity;

public abstract class BaseActivity extends AppCompatActivity {

    public void setupBottomNavigation() {
        // 首页点击
        findViewById(R.id.navHome).setOnClickListener(v -> {
//            appBarLayout.setVisibility(View.VISIBLE);
//            viewPager.setCurrentItem(1, false);
            startActivity(new Intent(this, HomeActivity.class));
            finish();
        });

        // 创作点击
        findViewById(R.id.navCreate).setOnClickListener(v -> {
            startActivity(new Intent(this, CreateActivity.class));
            finish();
        });

        // 消息点击
        findViewById(R.id.navMessage).setOnClickListener(v -> {
            startActivity(new Intent(this, MessageActivity.class));
            finish();
        });

        // 我的点击
        findViewById(R.id.navProfile).setOnClickListener(v -> {
            startActivity(new Intent(this, ProfileActivity.class));
            finish();
        });
    }
}